﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using topicos2_oztech_drturin.Banco;

namespace topicos2_oztech_drturin
{
	public partial class Default : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{

		}

        protected void Button1_Click(object sender, EventArgs e)
        {
            PacienteDB cons = new PacienteDB();

            if (cons.ValidarLogin(TextBox1.Text, TextBox2.Text)) 
            {
                Response.Redirect("~/Paciente/Resumo.aspx");
            } else 
            {
                Label3.Text = "CPF ou Senha incorretos.";
                TextBox1.Text = "";
                TextBox2.Text = "";
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            TextBox1.Text = "";
            TextBox2.Text = "";

            Response.Redirect("~/Paciente/Cadastro.aspx");
        }
    }
}